#include "newwindow.h"
#include "ui_newwindow.h"
#include "mainscene.h"
#include "ui_mainscene.h"
#include"map.h"
#include"apple.h"
#include"bomb.h"
#include<QKeyEvent>
#include<qtimer.h>
#include<qrect.h>
#include<qpainter.h>
#include<newwindow.h>
#include <ctime>
#include<QFont>
#include <QPushButton>
#include<QSize>
#include<QApplication>



newWindow::newWindow(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::newWindow)
{
    ui->setupUi(this);
    guide="游戏指引:";
    guide1="1.点击“PLAY”按钮开始游戏，通过键盘⬅️➡️控制“都市丽人”头像移动";
    guide2="2.接到苹果则得分加一，若碰到炸弹则游戏结束，此时可点击“REPLAY”重新开始";
    guide3="3.点击“PAUSE”可暂停游戏，点击“GOON”可继续游戏";
    guide4="4.右上角有计时器，每过15s游戏会加速一次呦～";
    guide5="5.如果碰到炸弹后想继续游戏，也可以点击“GOON”继续进行";
    guide6="注意：随着游戏速度的加快，掉落的物品会变少，更难得分，快来体验一下吧！";


}

newWindow::~newWindow()
{
    delete ui;
}


void newWindow::paintEvent(QPaintEvent *event)
{

    QPainter painter(this);

    QFont font("Courier",15);
    painter.setFont(font);
    painter.setPen(Qt::blue);
    painter.setBrush(Qt::blue);
    painter.drawText(10,40,guide);

    QFont font1("Courier",15);
    painter.setFont(font1);
    painter.setPen(Qt::blue);
    painter.setBrush(Qt::blue);
    painter.drawText(10,70,guide1);

    QFont font2("Courier",15);
    painter.setFont(font2);
    painter.setPen(Qt::blue);
    painter.setBrush(Qt::blue);
    painter.drawText(10,100,guide2);

    QFont font3("Courier",15);
    painter.setFont(font3);
    painter.setPen(Qt::blue);
    painter.setBrush(Qt::blue);
    painter.drawText(10,130,guide3);

    QFont font4("Courier",15);
    painter.setFont(font4);
    painter.setPen(Qt::blue);
    painter.setBrush(Qt::blue);
    painter.drawText(10,160,guide4);

    QFont font5("Courier",15);
    painter.setFont(font5);
    painter.setPen(Qt::blue);
    painter.setBrush(Qt::blue);
    painter.drawText(10,190,guide5);

    QFont font6("Courier",15);
    painter.setFont(font6);
    painter.setPen(Qt::blue);
    painter.setBrush(Qt::blue);
    painter.drawText(10,220,guide6);
}
